package cn.fastoo.common.entity.system;

import cn.fastoo.common.sampleframe.springside.Collections3;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by lowkey on 17/7/24.
 */
public class AdminSystemDataPermission {

    private Long personalId;
    private List<AdminSystemOrganization> subOran ;

    public boolean hasPersonalId(){
        return personalId!=null;
    }

    public Long getPersonalId() {
        return personalId;
    }

    public void setPersonalId(Long personalId) {
        this.personalId = personalId;
    }

    public List<AdminSystemOrganization> getSubOran() {
        return subOran;
    }

    public void setSubOran(List<AdminSystemOrganization> subOran) {
        this.subOran = subOran;
    }

    public List<String> getSubOranIds(){
        List<String> result = null;
        if(Collections3.isNotEmpty(subOran)){
            result = new ArrayList<>();
            for (AdminSystemOrganization t : subOran) {
                result.add(t.getId().toString());
            }
        }   
        return result;
    }
}
